﻿using System.Collections;
using System.Collections.Generic;
using LitJson;
using UnityEngine;



/// <summary>
/// 好友申请请求通知（该Request组件无SendRequest仅用于响应时处理）
/// </summary>
public class NoticeAddFriendRequest : BaseRequest {
	protected override void Awake()
	{
		_controllerType = ControllerType.USER;
		_methodType = MethodType.NOTICE_ADD_FRIEND;
		
		base.Awake();
	}

	public override void OnResponse(string data)
	{
		// 开启一个新的回复面板（用于同意或拒绝）
		JsonData respJsonData = JsonMapper.ToObject(data);
		string msg = respJsonData["msg"].ToString();
		int friendId = (int)respJsonData["data"]["friendId"];
		ReplyAddFriendPanel replyAddFriendPanel =
			(ReplyAddFriendPanel) UnityFacade.Instance.UiManager.PushPanel(PanelType.ReplyAddFriendPanel);
		replyAddFriendPanel.SyncShow(msg,friendId);
	}

	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		
	}
}
